#include <iostream>
#include <curl/curl.h>
#include "Download.h"

int main(int argc, char* argv[])
{
    std::string strUrl = "https://az764295.vo.msecnd.net/stable/6c3e3dba23e8fadc360aed75ce363ba185c49794/VSCodeUserSetup-x64-1.81.1.exe";
    int thNum = 3;

    if (argc > 1)
    {
        strUrl = argv[1];
    }
    if (argc > 2)
    {
        thNum = std::atoi(argv[2]);
    }
    
    /* 全局初始化 */
	curl_global_init(CURL_GLOBAL_ALL);

    try
    {
        CDownload dl;
        dl.Down(strUrl, thNum);
    }
    catch(const std::exception& e)
    {
        std::cerr << "下载异常：" << e.what() << '\n';
    }

  


    curl_global_cleanup();
    
    return 0;
}